package com.cby.jetpack.sample

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.cby.jetpack.sample.appstartup.AppStartUpActivity
import com.cby.jetpack.sample.binding.*
import com.cby.jetpack.sample.databinding.ActivityMainBinding
import com.cby.jetpack.sample.ext.binding
import com.cby.jetpack.sample.ext.start
import com.cby.jetpack.sample.navigation.NavigationMainActivity
import com.cby.jetpack.sample.paging3.GankGirlListActivity
import com.cby.jetpack.sample.result.SimpleResultActivity
import com.cby.jetpack.sample.worker.WorkManagerActivity

class MainActivity : AppCompatActivity() {

    private val binding: ActivityMainBinding by binding()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding.btnActivityResult.setOnClickListener {
            start(SimpleResultActivity::class.java)
        }

        binding.btnViewBinding.setOnClickListener {
            start(TestViewBindActivity::class.java)
        }

        binding.btnDataBinding.setOnClickListener {
            start(DataBindMainActivity::class.java)
        }

        binding.btnPaging3.setOnClickListener {
            start(GankGirlListActivity::class.java)
        }

        binding.btnNavigation.setOnClickListener {
            start(NavigationMainActivity::class.java)
        }

        binding.btnWorkManager.setOnClickListener {
            start(WorkManagerActivity::class.java)
        }

        binding.btnAppStartUp.setOnClickListener {
            start(AppStartUpActivity::class.java)
        }
    }
}